/**
 * createUser:JAVA_TOM
 * FileName: PushController
 * Author:   14562
 * Date:     2019/1/14 10:10
 * Description:
 */
package com.javatom.zwl.stream_redis.controller;

import com.javatom.zwl.stream_redis.msgstream.MessageClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PushController {

    @Autowired
    @Qualifier(MessageClient.BIND)
    private MessageChannel push;
    @Autowired
    MessageClient messageClient;
//    @Autowired
//    MessageSender messageSender;
        @RequestMapping("/s")
        public String push() {
            userBean userBean=new userBean();
            userBean.setName(System.currentTimeMillis()+"");
            messageClient.bind().send(MessageBuilder.withPayload("dddd").build());
            return "ok";
        }
}
